<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>练习为school导航条</title>
</head>
<link rel="stylesheet" href="./reset.css">
<style>
  body{
    height: 2000px;
  }
  .nav {
    width: 1176px;
    height: 48px;
    background-color: #e8e7e3;
    margin: 100px auto;
    position: sticky;
    top: 10px;
  }

  .nav li {
    float: left;
    line-height: 48px;
  }

  li a {
    display: block;
    padding: 0 35px;
    text-decoration: none;
    text-align: center;
    font-size: 18px;
    color: #7777;
    font-family: Verdana, Geneva, '微软雅黑', '宋体';
  }

  li a:hover {
    background-color: #3f3f3f;
    color: #e8e7e3;
  }
</style>

<body>
  <ul class="nav">
    <li><a href="">HTML/CSS</a></li>
    <li><a href="">HTML/CSS</a></li>
    <li><a href="">HTML/CSS</a></li>
    <li><a href="">HTML/CSS</a></li>
    <li><a href="">HTML/CSS</a></li>
    <li><a href="">HTML/CSS</a></li>
    <li><a href="">HTML/CSS</a></li>
  </ul>
</body>

</html>